'''
from sys import argv

script, filename = argv

txt = open(filename)

print "Here's your file %r:" % filename
print txt.read()

print "Type the filename again:"
file_again = raw_input("> ")

txt_again = open(file_again)

print txt_again.read()



with open('D:\testGit\Test\test13.py', 'r') as f:
    for line in f:
        print(line)
        print('一行数据')

with open('filepath','r') as f:
    ff=f.read()
'''
# -*- coding: UTF-8 -*-
from encodings import gb18030

from Tools.scripts.objgraph import ignore
#
# file = open('a.txt','r+',encoding='utf-8')
#
# print(file.name)
# line = file.readlines()
# print ("Read Line: %s" % (line))
#
#
#
# # line = file.readlines()
# # print('read:%s' % (line))
# #
# # line = file.readlines(2)
# # print ("Read Line: %s" % (line))
#
# # for i in file.readlines():
# #     print (i)
# file.close()


# coding=utf-8
# def check_charset(file_path):
#     import chardet
#     with open(file_path, "rb") as f:
#         data = f.read(4)
#         charset = chardet.detect(data)['encoding']
#     return charset
#
#
# your_path = 'a.txt'
# with open(your_path, encoding=check_charset(your_path)) as f:
#     data = f.read()
#     print(data)


#
# filename2 = open('关键字.txt','r')
# print (filename2.readline())
# filename.read()
#
# with open(filename, 'r') as file1:
#     line = file1.readline()
#     counts = 1
#     while line:
#         if counts >= 50000000:
#             break
#         line = file1.readline()
#         counts += 1




'''
file1 = open('关键字.txt',encoding='gb18030',errors='ignore')
while 1:
lines = file1.readlines(10000)
if not lines:
break
for line in lines:
print(line)
f.close()

print (file1.readline())
'''